<template>
    <div>
        <!--面包屑导航-->
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/manhome' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>文书列表</el-breadcrumb-item>
        </el-breadcrumb>
        <!--用户列表主部分-->
        <el-card>
            <el-row :gutter="25">
                <el-col span="10">
                <!--搜索区--> 
                   <el-input placeholder="输入搜索内容" v-model="queryInfo.query" clearable @clear="getEssayList">
                    <el-button slot="append" icon="el-icon-search" @click="getEssayList"></el-button>
                   </el-input>
                </el-col>
            </el-row>
            <!--表格 border边框 stripe隔行变色-->
            <el-table :data="essayList" border stripe>
                <el-table-column label="文书Id" prop="Id"></el-table-column>
                <el-table-column label="标题" prop="Title"></el-table-column>
                <el-table-column label="年份" prop="Year"></el-table-column>
                <el-table-column label="内容" prop="Content"></el-table-column>
                <el-table-column label="操作" prop="Action"></el-table-column>
           <template >
               <!--<template slot-scope="scope">-->
                <el-button type="primary" icon="el-icon-show" size="mini" >查看详情</el-button>
               <!--<el-button type="primary" icon="el-icon-edit" size="mini" >修改</el-button>-->
               <!--<el-button type="danger" icon="el-icon-delete" size="mini" >删除</el-button>-->
               <!--<el-button type="primary" icon="el-icon-edit" size="mini" @click="showEditDialog(Id)">修改</el-button>-->
               <!--<el-button type="danger" icon="el-icon-delete" size="mini" @click="delete(Id)">删除</el-button>-->
           </template>
            </el-table>
            <!--分页组件-->
            <div>
                <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="currentPage4"
                    :page-sizes="[5, 10, 20, 30]"
                    :page-size="queryInfo.pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="total">
                </el-pagination>
            </div>
        </el-card>
    </div>
</template>
<script>
    export default{
        created(){
           this.getEssayList();
        },
        data(){
            return{
                //查询信息实体
                queryInfo:{
                    query:"",
                    pageNum:1,
                    pageSize:5,
                },
                essayList:[],//文书列表
                total:0,
            }

        },
        methods:{
           async getEssayList(){
                const {data:res} =await this.$http.get("allessay",{params:this.queryInfo});
                this.essayList=res.data;//列表数据封装
                this.total=res.number;//总数封装
            },
            //最大数
            handleSizeChange(newSize){
                this.queryInfo.pageSize=newSize;
                this.getEssayList();
            },
            //pageNum的触发
            handleCurrentChange(newPage){
                this.queryInfo.pageNum=newPage;
                this.getEssayList();
            },
        }
    }
            

</script>
<style  scoped>
.el-breadcrumb{
    margin-bottom: 15px;
    font-size: 15px;
}
</style>